package com.kit.data.kitopeso.dialog;

import android.content.Context;
import android.content.DialogInterface;
import android.text.Html;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.kit.data.kitopeso.R;
import com.kit.data.kitopeso.base.BaseDialog;
import com.kit.data.kitopeso.databinding.KitoMorecardDialogBinding;
import com.kit.data.kitopeso.tools.ResUtils;
import com.kit.data.kitopeso.tools.ViewUtils;


public class MoreCardDialog extends BaseDialog<KitoMorecardDialogBinding> {
    public MoreCardDialog(@NonNull Context context) {
        super(context);
    }

    public MoreCardDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected MoreCardDialog(@NonNull Context context, boolean cancelable, @Nullable DialogInterface.OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected KitoMorecardDialogBinding initViewBinding(LayoutInflater inflater) {
        return KitoMorecardDialogBinding.inflate(inflater);
    }

    @Override
    protected void initView() {
        binding.tvCancel.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            dismiss();
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickCancel();
            }
        });
        binding.tvOk.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            dismiss();
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickOk();
            }
        });
        binding.tvClose.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickColse();
            }
            dismiss();
        });

        binding.tvTitle.setText(Html.fromHtml(ResUtils.s(R.string.account_morecard_title)));

    }
}
